<#assign disabledFirst = "<a disabled>1</a>"/>
<#assign disabledPrior = "<a disabled><<</a>"/>
<#assign disabledNext = "<a disabled>>></a>"/>
<#assign disabledPageNumber = "<a disabled>${pageNumber}</a>"/>
<#assign disabledLast = "<a disabled>${pageCount}</a>"/>
<#assign enabledFirst = "<a href='" + uri + "?" + pageNumberParamName + "=1" + url + "'>1</a>"/>
<#assign enabledFirst2 = "<a href='" + uri + "?" + pageNumberParamName + "=2" + url + "'>2</a>"/>
<#assign enabledNumber = "<a href='" + uri + "?" + pageNumberParamName + "=" + (pageNumber) + url + "'>pageNumber</a>"/>
<#assign enabledPrior = "<a href='" + uri + "?" + pageNumberParamName + "=" + (pageNumber - 1) + url + "'><<</a>"/>
<#assign enabledNext = "<a href='" + uri + "?" + pageNumberParamName + "=" + (pageNumber + 1) + url + "'>>></a>"/>
<#assign enabledLast = "<a href='" + uri + "?" + pageNumberParamName + "=" + pageCount + url + "'>${pageCount}</a>"/>
<#assign enabledLast2 = "<a href='" + uri + "?" + pageNumberParamName + "=" + (pageCount - 1) + url + "'>${pageCount - 1}</a>"/>
<#assign info = "共" + pageNumber + "/" + pageCount + "页&nbsp;" + pageSize + "条/页&nbsp;共" + recordCount + "条记录"/>

<#macro repeat start count>
<#list start..count as x>
	<#if pageNumber == x>
		<a disabled>${x}</a>
	<#else>
		<a href='${uri}?${pageNumberParamName}=${x}&${url}'>${x}</a>
	</#if>
</#list>
</#macro>
<#global totalCount=9>
<#-- 偏移位数  -->
<#global rightCount=4>
<#if pageCount <= 1>
 ${disabledPrior}${disabledFirst}${disabledNext}
<#elseif (pageCount <= totalCount)>
		<#if pageNumber == 1 >
		 ${disabledPrior} <@repeat start=1 count=pageCount /> ${enabledNext}  
		</#if>
		
		<#if (pageNumber > 1) && (pageNumber < pageCount)>
		 ${enabledPrior}<@repeat start=1 count=pageCount /> ${enabledNext} 
		</#if>
		
		<#if pageNumber == pageCount>
		 ${enabledPrior}<@repeat start=1 count=pageCount />${disabledNext} 
		</#if>
<#-- 1 2...4 5 6 7 8 9 10...12 13  -->
<#elseif (pageCount <= 13)>
		<#if (pageNumber == 1)>
		${disabledPrior} <@repeat start=1 count=(pageNumber+rightCount) />...${enabledLast2}${enabledLast} ${enabledNext}
		<#elseif (pageNumber >= 2) && (pageNumber <= 5) >
		 ${enabledPrior} <@repeat start=1 count=(pageNumber+rightCount) />...${enabledLast2}${enabledLast} ${enabledNext}  
		<#elseif pageNumber == pageCount>
			${enabledPrior} ${enabledFirst}${enabledFirst2} ... <@repeat start=pageNumber-2 count=(pageCount-2) />${enabledLast2}${disabledLast} ${disabledNext}
		<#elseif pageNumber == (pageCount - 1)>
			${enabledPrior} ${enabledFirst}${enabledFirst2} ... <@repeat start=pageNumber-2 count=(pageCount-2) />${disabledPageNumber}${enabledLast} ${enabledNext}
		<#else>
		 ${enabledPrior} ${enabledFirst}${enabledFirst2}...<@repeat start=pageNumber-2 count=(pageCount-2) />${enabledLast2}${enabledLast} ${enabledNext}  
		</#if>
<#else>
		<#if (pageNumber == 1)>
		 ${disabledPrior} <@repeat start=1 count=(pageNumber+rightCount) />...${enabledLast2}${enabledLast} ${enabledNext}  
		<#elseif (pageNumber >= 2) && (pageNumber <= 5) >
		 ${enabledPrior} <@repeat start=1 count=(pageNumber+rightCount) />...${enabledLast2}${enabledLast} ${enabledNext}  
		<#elseif pageNumber == pageCount>
			${enabledPrior} ${enabledFirst}${enabledFirst2} ... <@repeat start=pageNumber-2 count=(pageCount-2) />${enabledLast2}${disabledLast} ${disabledNext}
		<#elseif pageNumber == (pageCount - 1)>
			${enabledPrior} ${enabledFirst}${enabledFirst2} ... <@repeat start=pageNumber-2 count=(pageCount-2) />${disabledPageNumber}${enabledLast} ${enabledNext}
		<#elseif (pageNumber > 5) && pageNumber <= (pageCount - 7)>
		 ${enabledPrior} ${enabledFirst}${enabledFirst2}...<@repeat start=pageNumber-2 count=(pageNumber+rightCount) />...${enabledLast2}${enabledLast} ${enabledNext}  
		<#else>
		 ${enabledPrior} ${enabledFirst}${enabledFirst2}...<@repeat start=pageNumber-2 count=(pageCount-2) />${enabledLast2}${enabledLast} ${enabledNext}  
		</#if>
</#if>

